<!--<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>{:M('name')}</title>
<meta http-equiv="X-UA-Compatible" content="IE=8">
<meta name="keywords" content='zhidao'>
<meta name="description" content='zhidao'>
<link rel="stylesheet" href="/public/static/css/pc_reset.css">
<link rel="stylesheet" href="/public/static/css/qb_ui.css">
<link rel="stylesheet" href="/public/static/icon/icon.css">
<script type="text/javascript" src="/public/static/js/core/jquery.min.js"></script>
<script type="text/javascript" src="/public/static/layer/layer.js"></script>
</head>
<body>
<link rel="stylesheet" href="/public/static/zhidao/head.css">
<div class="HeadContainer">
	<ul class="TopBox">
		<li class="logo"><a href="#"><img src="/public/static/zhidao/logo.png"></a></li>
		<li class="menu">
			<a href="#" class="ck">问答系统</a>
			<a href="#">门户系统</a>
			<a href="#">技术联盟</a>
			<a href="#">网站首页</a>
		</li>
		<li class="search">
			<form action="#" method="post">
				<dl>
					<dt><input type="text" name="keyword" placeholder="输入关键字" required/><button type="submit"><i class="fa fa-search"></i></button></dt>
					<dd><a href="#">登录</a> <a href="#">注册</a></dd>					
				</dl>
			</form>
		</li>
	</ul>
</div>
-->
{extend name="$index_style_layout" /}

<!--SEO相关-->
{block name="head_title"}{$webdb.mseo_title?:$webdb.seo_title}{/block}
{block name="head_keword"}{$webdb.mseo_keyword?:$webdb.seo_keyword}{/block}
{block name="head_description"}{$webdb.mseo_description?:$webdb.seo_description}{/block}

{block name="body_content"}


<link rel="stylesheet" href="/public/static/zhidao/list.css">
<div class="MainContainer">
	<div class="Container">
		<div class="LeftCnt"> 
			<dl class="BaseInfo">
				<dt>今日<span id="div_today_post">0</span>问 昨日<span id="div_yesterday_post">0</span>问 </dt>
				<dd>问答主页<i class="fa fa-pagelines"></i></dd>
			</dl> 
			<div class="ListBox">
				<div class="head">
					<span onclick="listbbs(0,'list')" class="ck">最新动态</span>
					<span onclick="listbbs(1,'id')">最新提问</span>
					<span onclick="listbbs(2,'money')">高悬赏</span>
					<span onclick="listbbs(3,'view')">热门问题</span>					 
				</div>
				<div class="ShowLists">
<!--name是标签名，跟通用标签不能重名，rows取几条数据,order按什么方式排序，list代表可控排序，id即时间,view代表浏览量-->
		{qb:listpage name="zhidao_list_page_pc" status="1" rows="20" order="list"}
					<ul class="list">
						<li class="icon"><a href="{:get_url('user',['uid'=>$rs['uid']])}" target="_blank"><img src="{:get_user_icon($rs['uid'])}" onerror="this.src='__STATIC__/images/nobody.gif'" ></a></li>
						<li class="info">
							<div class="title">
							{if $rs.money>0}
							 <i class='fa fa-fw fa-database'></i><em class='c_r'> {$rs.money} </em>
							{/if}
							<a target="_blank" href="{:urls('content/show',['id'=>$rs['id']])}">{$rs.title}</a>
							{if $rs.list>time()}<span class="top">顶</span>{/if} {eq name="rs.status" value="2"}<span class="com">精</span>{/eq} {gt name="rs.view" value="200"}<span class="hot">热</span>{/gt}  {if (time()-$rs.create_time<3600*24)}<span class="hot">新</span> {/if}</div>
							<div class="more"><a href="{:get_url('user',['uid'=>$rs['uid']])}" target="_blank">{$rs.username}</a> <span><i class="fa fa-clock-o"></i>{$rs.create_time|format_time=true} 
							{if $rs.replynum>0}
							<i class="fa fa-fw fa-user-o"></i>回复: {$rs.replyuser} {$rs.list|format_time=true}
							{/if}
							</span></div>
						</li>
						<li class="hits"><i class="si si-eye"></i>{$rs.view}</li>
						<li class="reply"><i class="fa fa-commenting-o"></i>{$rs.replynum}</li>
					</ul>
		{/qb:listpage} 
				</div><!--{$pages} 这是传统分页-->
				<div class="ShowMoreBBs"><button type="button" onclick="ShowMoreBBs()">查看更多</button></div>
			</div>
		</div>
		<div class="RightCnt">
			<div class="RightSide">
				<dl class="RightBase">
					<dt>
						<a href="{:urls('content/add')}"><button type="button">发布新问题</button></a>
						 <ul><ol><span>问题 </span><em id="div_total_topic">00</em></ol> <li><span>回复 </span><em id="div_total_post">00</em></li></ul>
						<div>共 <span id="div_total_member">20</span> 位会员 欢迎新会员 <a href="#" id="div_new_member">xxx</a></div> 
					</dt>
<script type="text/javascript">
$(function(){
	var today_post = 0;
	var yesterday_post = 0;
	var total_post = 0;
	var total_topic = 0;
	var day_top_post = 0;
	var total_member = 1;
	var new_member = '';
	$.get("{:urls('wxapp.infomsg/index')}",function(res){
		if(res.code==0){
			today_post = res.data.today_post;
			yesterday_post = res.data.yesterday_post;
			total_post = res.data.total_post;
			total_topic = res.data.total_topic;
			total_replace=total_post-total_topic;
			day_top_post = res.data.day_top_post;
		}
		$("#div_today_post").html(today_post);
		$("#div_yesterday_post").html(yesterday_post);
		$("#div_total_topic").html(total_topic);
		$("#div_total_post").html(total_replace);
	});

	$.get("{:urls('index/wxapp.member/get_list',['rows'=>1])}",function(res){
		if(res.code==0){
			new_member = res.data[0].username;
			total_member = res.paginate.total;
		}
		$("#div_total_member").html(total_member);
		$("#div_new_member").html(new_member);
	});

});

</script>

					<dd>
						<div class="h"><span>问题分类</span></div>
						<ul>
{volist name="''|sort_config" id="rs"}
							<li><a href="{:urls('content/index',['fid'=>$rs['id']])}" {eq name="$fid" value="$rs.id"}class="ck"{/eq}>{$rs.name}</a></li>
{/volist}
						</ul>
					</dd>
				</dl>
				<div class="SideMores" style="display:none;">
					<div class="h"><span>活跃会员</span></div>
					<ul class="ListMember">
{qb:tag name="zhidao_list_member" type="member" order="lastvist" rows="2" class="app\index\controller\Member@labelShow"}
						<li><a href="{$rs.url}"><span><img src="{$rs.picurl}" onerror="this.src='__STATIC__/images/nobody.gif'"  onmouseover="changeShowImg($(this),'over');" onmouseout="changeShowImg($(this),'out');" ></span><em>{$rs.title}</em></a></li>
{/qb:tag}

					</ul>
					<script type="text/javascript">
						function changeShowImg(obj,mouse){
							if(mouse=='over'){
								obj.animate({"width":"150%","height":"150%"},300);
							}else if(mouse=='out'){
								obj.animate({"width":"100%","height":"100%"},300);
							}
						}
					</script>
					<div class="MOreShow"><button class="showMoreShop" type="button" onclick="showMoreMember('{qb:url name='zhidao_list_member'/}')">更多<i class="fa fa-chevron-down"></i></button></div>
				</div>
<script type="text/javascript">
var shoppage=1;
function showMoreMember(url){	
	shoppage++;
	$.get(url+shoppage+'&'+Math.random(),function(res){
		if(res.code==0){
			if(res.data==''){
				layer.msg("已经显示完了！",{time:500});
				$('.showMoreShop').attr('onclick','');
				$('.showMoreShop').html('显示完了');
				$('.showMoreShop').css({'background':'#CCC'});
			}else{
				res.data="<div class='pages"+shoppage+"'>"+res.data+"</div>";			
				$('.ListMember').append(res.data);
				$('.ListMember .pages'+shoppage).hide();
				$('.ListMember .pages'+shoppage).show(500);
			}
		}else{
			layer.msg(res.msg,{time:2500});
		}
	});
}
</script>
				<div class="SideMores">
					<div class="h"><span>正在求助</span></div>
					<ul class="ListNewfen">
{qb:tag name="pc_zhidao_indexpage" type="zhidao" order="status" rows="8" where="best_rid=0"}
						<li><a href="{$rs.url}">{$rs.title}</a></li>
{/qb:tag}
					</ul>
					<div class="MOreShow msnewfen"><button type="button" onclick="MoreShowNewfen('{qb:url name='pc_zhidao_indexpage' /}')">更多<i class="fa fa-chevron-down"></i></button></div>
				</div>
<script type="text/javascript">
var M_s_page = 1;
function MoreShowNewfen(url){
	M_s_page++;
	$.get(url+M_s_page+'&'+Math.random(),function(res){
		if(res.code==0){
			if(res.data==''){
				layer.msg("已经显示完了！",{time:500});
				$('.msnewfen').hide();
			}else{
				$('.ListNewfen').append(res.data);
			}
		}else{
			layer.msg(res.msg,{time:2500});
		}
	});
}
</script>

				<div class="SideMores">
					<div class="h"><span>友情链接</span></div>
					<ul class="FriendLink">
						{qb:tag name="zhidao_pcindex_friendlink" type='text'}
						<li><a href="http://www.qibomb.com" target="_blank">齐博模板网</a></li>
						<li><a href="http://www.qibomoban.com" target="_blank">齐博模板堂</a></li>
						<li><a href="http://www.admin5.net/" target="_blank">A5站长网</a></li>
						<li><a href="http://www.im286.com/" target="_blank">落伍者</a></li>
						<li><a href="http://www.php168.com" target="_blank">齐博软件</a></li>
						<li><a href="http://www.chinaccnet.com/" target="_blank">中电云集</a></li>
						{/qb:tag}
					</ul>
				</div>
				<dl class="WXcode">
					<dt>扫一扫访问手机版</dt>
					<dd>
					<img src="{:get_qrcode(get_url('location'))}"/>
					</dd>
				</dl>
			</div>
		</div>
	</div>
</div>
<div class="topUpCont">
    <ul>
    	<ol><i class="fa fa-angle-double-up"></i></ol>
        <li>回到顶部</li>
    </ul>
</div>

<script type="text/javascript">
var Mpage=1;
var byorder='list';
var showmorebbs='<button type="button" onclick="ShowMoreBBs()">查看更多</button>';
function ShowMoreBBs(){
	Mpage++;
	$('.ShowMoreBBs').html('内容加载中……');
	$.get('{qb:list_url name="zhidao_list_page_pc" /}'+Mpage+'&order='+byorder+'&'+Math.random(),function(res){
		if(res.code==0){
			if(res.data==''){
				layer.msg("已经显示完了！",{time:500});
				$('.ShowMoreBBs').html('');
			}else{				
				$('.ShowLists').append("<span class='Mpage"+Mpage+"'></span>");
				$('.Mpage'+Mpage).hide();
				$('.Mpage'+Mpage).html(res.data);
				$('.Mpage'+Mpage).fadeIn();
				$('.ShowMoreBBs').html(showmorebbs);
				scroll_get = true;
			}
		}else{
			layer.msg(res.msg,{time:2500});
		}
	});
}

//滚动显示更多
var scroll_get = true;	//做个标志,不要反反复复的加载
$(document).ready(function () {
	$(window).scroll(function () {
		if (scroll_get==true &&  (400 + $(window).scrollTop())>($(document).height() - $(window).height())) {
			scroll_get = false;
			layer.msg('内容加截中,请稍候',{time:1000});
			ShowMoreBBs();
		}
	});
});


function listbbs(num,order){
	Mpage=1;
	byorder=order;
	console.log(byorder);
	$('.ListBox .head span').removeClass('ck');
	$('.ListBox .head span').eq(num).addClass('ck');
	console.log('{qb:list_url name="zhidao_list_page_pc" /}'+Mpage+'&order='+byorder)
	$.get('{qb:list_url name="zhidao_list_page_pc" /}'+Mpage+'&order='+byorder+'&'+Math.random(),function(res){
		if(res.code==0){
			if(res.data==''){
				layer.msg("没有相应的问题！",{time:500});
				$('.ShowLists').html('');
				$('.ShowMoreBBs').html('');
			}else{
				$('.ShowLists').html("<span class='Mpage"+Mpage+"'></span>");
				$('.Mpage'+Mpage).hide();
				$('.Mpage'+Mpage).html(res.data);
				$('.Mpage'+Mpage).fadeIn();
				$('.ShowMoreBBs').html(showmorebbs);
			}
		}else{
			layer.msg(res.msg,{time:2500});
		}
	});
}
$(document).ready(function () {
	//右边页面的高度
	var rightBoxH=$('.RightSide').height();
	//头部高度+35px间距
	var headBoxH=$('.HeadContainer').height()+35;
	$(window).scroll(function () {
		var scroll_Height=$(window).scrollTop();
		if(scroll_Height>rightBoxH){
			$('.RightBase').addClass('RightBase1');
			var thistopH=scroll_Height-headBoxH;
			$(".RightBase").css({'top':thistopH+'px'});
		}else{
			$('.RightBase').removeClass('RightBase1');
		}
		if (scroll_Height > 100) {
			$(".topUpCont").show();
		} else {
			$(".topUpCont").hide();
		}		
	});
	$(".topUpCont").click(function () {
		$("html,body").animate({scrollTop:0},500);
	});
});	

</script>
{/block}